package com.example.wangfanwangluo.wangfanboss;

import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import android.widget.Toast;

import com.example.wangfanwangluo.wangfanboss.PublicDirectory.functions;


public class forget1 extends AppCompatActivity {

    private TextView exitbtn;
    private Typeface iconfont;
    private TextView phonetv;
    private TextView sendtv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_forget1);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        ActionBar actionbar = getSupportActionBar();
        if (actionbar != null){
            actionbar.hide();
        }
        initviews();

    }
    public void initviews(){
        //设置iconfont字体
        iconfont = Typeface.createFromAsset(getAssets(), "iconfont/iconfont.ttf");
        exitbtn = (TextView)findViewById(R.id.exitbtn);
        exitbtn.setTypeface(iconfont);
        phonetv = (TextView)findViewById(R.id.phone_forget1);
        sendtv = (TextView)findViewById(R.id.send_forget1);
        exitbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //返回登录界面
               finish();
            }
        });

        sendtv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //校验手机号是否合法，发送验证码，发送网络请求
                if (!functions.phoneCheck(phonetv.getText().toString())){
                    Toast.makeText(forget1.this,"手机号格式有误",Toast.LENGTH_SHORT).show();
                    return;
                }
                //进入忘记密码2
                Intent intent = new Intent(forget1.this,forget.class);
                startActivity(intent);
            }
        });




    }
}
